<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>SemOpt: src/SetArgumentsVector.cpp Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">SemOpt
   &#160;<span id="projectnumber">0.2alpha5-SCC</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('SetArgumentsVector_8cpp.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">src/SetArgumentsVector.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="SetArgumentsVector_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00008"></a>00008 <span class="preprocessor">#include &quot;SetArgumentsVector.h&quot;</span>
<a name="l00009"></a>00009 
<a name="l00015"></a><a class="code" href="classSetArgumentsVector.html#aff070d4484bdcb0dcc53321dbd3efabc">00015</a> <a class="code" href="classSetArgumentsVector.html#aff070d4484bdcb0dcc53321dbd3efabc" title="constructs an empty vector of SetArgumentsVector">SetArgumentsVector::SetArgumentsVector</a>() {
<a name="l00016"></a>00016         this-&gt;v = vector&lt;SetArguments*&gt;();
<a name="l00017"></a>00017 }
<a name="l00018"></a>00018 
<a name="l00072"></a><a class="code" href="classSetArgumentsVector.html#afb82f5a112609999e94719baf36f72e2">00072</a> <span class="keywordtype">void</span> <a class="code" href="classSetArgumentsVector.html#afb82f5a112609999e94719baf36f72e2" title="clone all the references used in the caller set">SetArgumentsVector::clone</a>(<a class="code" href="classSetArgumentsVector.html" title="Class representing a vector of labelling assignment.">SetArgumentsVector</a>* list){
<a name="l00073"></a>00073         <span class="keywordflow">for</span> (<span class="keyword">auto</span> it=this-&gt;<a class="code" href="classSetArgumentsVector.html#aa633ab749e1200f2321d80ce76a98505" title="return the first element of the list">begin</a>(); it!=this-&gt;<a class="code" href="classSetArgumentsVector.html#a9a862e30af38a72e402e1ae4f7f5425b" title="return the last element of the list">end</a>();it++){
<a name="l00074"></a>00074                 list-&gt;<a class="code" href="classSetArgumentsVector.html#ae6509c9af6ffd7d9bbee2e0fbe3691ec" title="add a new SetArguments in this set">push_back</a>(*it);
<a name="l00075"></a>00075         }
<a name="l00076"></a>00076 }
<a name="l00077"></a>00077 
<a name="l00088"></a><a class="code" href="classSetArgumentsVector.html#ac2aaabbfcdd58300c645650b7b7e19e2">00088</a> <a class="code" href="classSetArgumentsVector.html#aff070d4484bdcb0dcc53321dbd3efabc" title="constructs an empty vector of SetArgumentsVector">SetArgumentsVector::SetArgumentsVector</a>(vector&lt;SetArguments*&gt;&amp; _list){
<a name="l00089"></a>00089         this-&gt;v = vector&lt;SetArguments*&gt;(_list);
<a name="l00090"></a>00090 }
<a name="l00091"></a>00091 
<a name="l00092"></a>00092 <span class="comment">//TODO testing</span>
<a name="l00152"></a><a class="code" href="classSetArgumentsVector.html#a1d1da16bbccc30b32751ee478d9b1293">00152</a> <span class="comment"></span><a class="code" href="classSetArgumentsVector.html#a1d1da16bbccc30b32751ee478d9b1293" title="Free correctly a SetArgumentsVector.">SetArgumentsVector::~SetArgumentsVector</a>() {
<a name="l00153"></a>00153         <span class="comment">/*for (auto it=this-&gt;v.begin();it!=this-&gt;v.end();it++){</span>
<a name="l00154"></a>00154 <span class="comment">                cout &lt;&lt; &quot;elimino: &quot; &lt;&lt; endl;</span>
<a name="l00155"></a>00155 <span class="comment">                delete (*it);</span>
<a name="l00156"></a>00156 <span class="comment">        }*/</span>
<a name="l00157"></a>00157 }
<a name="l00158"></a>00158 
<a name="l00187"></a><a class="code" href="classSetArgumentsVector.html#a92e628177038610e3ec4e34a76e46f6f">00187</a> <span class="keywordtype">void</span> <a class="code" href="classSetArgumentsVector.html#a92e628177038610e3ec4e34a76e46f6f" title="add to all the set in the SetArgumentsVector the elements stored in the parameter">SetArgumentsVector::addSetArgumentsToAll</a>(<span class="keyword">const</span> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* <span class="keyword">set</span>){
<a name="l00188"></a>00188         <span class="keywordflow">for</span> (<span class="keyword">auto</span> itlab=this-&gt;<a class="code" href="classSetArgumentsVector.html#aa633ab749e1200f2321d80ce76a98505" title="return the first element of the list">begin</a>(); itlab!=this-&gt;<a class="code" href="classSetArgumentsVector.html#a9a862e30af38a72e402e1ae4f7f5425b" title="return the last element of the list">end</a>();itlab++){
<a name="l00189"></a>00189                 <span class="keywordflow">for</span> (<span class="keyword">auto</span> itset=set-&gt;begin(); itset!=<span class="keyword">set</span>-&gt;end();itset++){
<a name="l00190"></a>00190                         (*itlab)-&gt;add_Argument(*itset);
<a name="l00191"></a>00191                         <span class="comment">//itlab-&gt;add_label(*itset,(Label)((*itset)-&gt;getName()));</span>
<a name="l00192"></a>00192                         <span class="comment">//itlab-&gt;inargs()-&gt;add_Argument(*itset);</span>
<a name="l00193"></a>00193                 }
<a name="l00194"></a>00194         }
<a name="l00195"></a>00195 }
<a name="l00196"></a>00196 
<a name="l00203"></a><a class="code" href="classSetArgumentsVector.html#ae4a302a74ba91f219fb96c20553db4bc">00203</a> <span class="keywordtype">bool</span> <a class="code" href="classSetArgumentsVector.html#ae4a302a74ba91f219fb96c20553db4bc" title="check wether or not this set is completely empty.">SetArgumentsVector::empty</a>(){
<a name="l00204"></a>00204         <span class="keywordflow">return</span> this-&gt;v.empty();
<a name="l00205"></a>00205 }
<a name="l00206"></a>00206 
<a name="l00211"></a><a class="code" href="classSetArgumentsVector.html#a8e0ea5f84c56a04aefada08b4dd87c08">00211</a> <span class="keywordtype">void</span> <a class="code" href="classSetArgumentsVector.html#a8e0ea5f84c56a04aefada08b4dd87c08" title="pop the top SetArguments of the vector">SetArgumentsVector::pop_back</a>(){
<a name="l00212"></a>00212         this-&gt;v.pop_back();
<a name="l00213"></a>00213 }
<a name="l00214"></a>00214 
<a name="l00248"></a><a class="code" href="classSetArgumentsVector.html#a8cc07d968854d13c5dd4305bbcdaf96a">00248</a> <span class="keywordtype">bool</span> <a class="code" href="classSetArgumentsVector.html#a8cc07d968854d13c5dd4305bbcdaf96a" title="check wether or not a SetArguments exist in the caller SetArgumentsVector">SetArgumentsVector::exist</a>(<span class="keyword">const</span> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* lab)<span class="keyword">const </span>{
<a name="l00249"></a>00249         <span class="comment">// confronto per puntatori e poi per valori. l&#39;or è lazy</span>
<a name="l00250"></a>00250         <span class="keywordflow">for</span> (<span class="keyword">auto</span> it=this-&gt;<a class="code" href="classSetArgumentsVector.html#aa633ab749e1200f2321d80ce76a98505" title="return the first element of the list">begin</a>(); it!=this-&gt;<a class="code" href="classSetArgumentsVector.html#a9a862e30af38a72e402e1ae4f7f5425b" title="return the last element of the list">end</a>(); it++)
<a name="l00251"></a>00251                 <span class="keywordflow">if</span> ( lab==(*it) )
<a name="l00252"></a>00252                         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00253"></a>00253 
<a name="l00254"></a>00254         <span class="keywordflow">for</span> (<span class="keyword">auto</span> it=this-&gt;<a class="code" href="classSetArgumentsVector.html#aa633ab749e1200f2321d80ce76a98505" title="return the first element of the list">begin</a>(); it!=this-&gt;<a class="code" href="classSetArgumentsVector.html#a9a862e30af38a72e402e1ae4f7f5425b" title="return the last element of the list">end</a>(); it++)
<a name="l00255"></a>00255                 <span class="keywordflow">if</span> (lab-&gt;<a class="code" href="classSetArguments.html#a0c4a6994f83dfccf2d34022cb132b782" title="verify that 2 SetArguments are equal">equal</a>(**it))
<a name="l00256"></a>00256                         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00257"></a>00257 
<a name="l00258"></a>00258         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00259"></a>00259 }
<a name="l00260"></a>00260 
<a name="l00266"></a><a class="code" href="classSetArgumentsVector.html#a97d6b6d14b59dbf1a51aaf10bda05f94">00266</a> <a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* <a class="code" href="classSetArgumentsVector.html#a97d6b6d14b59dbf1a51aaf10bda05f94" title="the SetArguments positioned to i index">SetArgumentsVector::at</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i)<span class="keyword"> const</span>{
<a name="l00267"></a>00267         <span class="keywordflow">return</span> this-&gt;v.at(i);
<a name="l00268"></a>00268 }
<a name="l00269"></a>00269 
<a name="l00279"></a><a class="code" href="classSetArgumentsVector.html#ae6509c9af6ffd7d9bbee2e0fbe3691ec">00279</a> <span class="keywordtype">void</span> <a class="code" href="classSetArgumentsVector.html#ae6509c9af6ffd7d9bbee2e0fbe3691ec" title="add a new SetArguments in this set">SetArgumentsVector::push_back</a>(<a class="code" href="classSetArguments.html" title="Class encompassing a set of arguments.">SetArguments</a>* <span class="keyword">set</span>){
<a name="l00280"></a>00280         this-&gt;v.push_back(<span class="keyword">set</span>);
<a name="l00281"></a>00281 }
<a name="l00282"></a>00282 
<a name="l00286"></a><a class="code" href="classSetArgumentsVector.html#a76cc9937a09ecfec12eb82777717b255">00286</a> <span class="keywordtype">void</span> <a class="code" href="classSetArgumentsVector.html#a76cc9937a09ecfec12eb82777717b255">SetArgumentsVector::clearAll</a>(){
<a name="l00287"></a>00287         this-&gt;v.clear();
<a name="l00288"></a>00288 }
<a name="l00289"></a>00289 
<a name="l00295"></a><a class="code" href="classSetArgumentsVector.html#acfa816d29faed3b3e19a48d0457c6f0a">00295</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classSetArgumentsVector.html#acfa816d29faed3b3e19a48d0457c6f0a" title="the size of this set of SetArguments">SetArgumentsVector::size</a>()<span class="keyword"> const</span>{
<a name="l00296"></a>00296         <span class="keywordflow">return</span> this-&gt;v.size();
<a name="l00297"></a>00297 }
<a name="l00298"></a>00298 
<a name="l00311"></a><a class="code" href="classSetArgumentsVector.html#aa633ab749e1200f2321d80ce76a98505">00311</a> SetArgumentsVectorIterator <a class="code" href="classSetArgumentsVector.html#aa633ab749e1200f2321d80ce76a98505" title="return the first element of the list">SetArgumentsVector::begin</a>()<span class="keyword"> const</span>{
<a name="l00312"></a>00312         <span class="keywordflow">return</span> SetArgumentsVectorIterator(this-&gt;v.begin());
<a name="l00313"></a>00313 }
<a name="l00314"></a>00314 
<a name="l00327"></a><a class="code" href="classSetArgumentsVector.html#a9a862e30af38a72e402e1ae4f7f5425b">00327</a> SetArgumentsVectorIterator <a class="code" href="classSetArgumentsVector.html#a9a862e30af38a72e402e1ae4f7f5425b" title="return the last element of the list">SetArgumentsVector::end</a>()<span class="keyword"> const</span>{
<a name="l00328"></a>00328         <span class="keywordflow">return</span> SetArgumentsVectorIterator(this-&gt;v.end());
<a name="l00329"></a>00329 }
<a name="l00330"></a>00330 
<a name="l00343"></a><a class="code" href="SetArgumentsVector_8cpp.html#a11dec1fd5f1eec92fd2adf03a57f6655">00343</a> ostream&amp; <a class="code" href="Argument_8cpp.html#a76ef732a0021f3ac6698582cf94a079e">operator&lt;&lt;</a>(ostream&amp; stream, <span class="keyword">const</span> <a class="code" href="classSetArgumentsVector.html" title="Class representing a vector of labelling assignment.">SetArgumentsVector</a>&amp; lablist){
<a name="l00344"></a>00344         stream &lt;&lt; <span class="stringliteral">&quot;{ &quot;</span>;
<a name="l00345"></a>00345         <span class="keywordflow">if</span> (lablist.<a class="code" href="classSetArgumentsVector.html#acfa816d29faed3b3e19a48d0457c6f0a" title="the size of this set of SetArguments">size</a>()!=0)
<a name="l00346"></a>00346                 <span class="keywordflow">for</span> (<span class="keyword">auto</span> it=lablist.<a class="code" href="classSetArgumentsVector.html#aa633ab749e1200f2321d80ce76a98505" title="return the first element of the list">begin</a>();it!=lablist.<a class="code" href="classSetArgumentsVector.html#a9a862e30af38a72e402e1ae4f7f5425b" title="return the last element of the list">end</a>();it++)
<a name="l00347"></a>00347                         stream &lt;&lt; **it &lt;&lt; <span class="stringliteral">&quot; &quot;</span>;
<a name="l00348"></a>00348         stream &lt;&lt; <span class="stringliteral">&quot; }&quot;</span>;
<a name="l00349"></a>00349         <span class="keywordflow">return</span> stream;
<a name="l00350"></a>00350 }
<a name="l00351"></a>00351 
<a name="l00372"></a><a class="code" href="SetArgumentsVector_8cpp.html#a705afb682028a4bed96866de368fec14">00372</a> <a class="code" href="classSetArgumentsVector.html" title="Class representing a vector of labelling assignment.">SetArgumentsVector</a> <a class="code" href="SetArgumentsVector_8cpp.html#a705afb682028a4bed96866de368fec14" title="overriding of the operator +.">operator+</a>(<a class="code" href="classSetArgumentsVector.html" title="Class representing a vector of labelling assignment.">SetArgumentsVector</a> a, <span class="keyword">const</span> <a class="code" href="classSetArgumentsVector.html" title="Class representing a vector of labelling assignment.">SetArgumentsVector</a>&amp; b){
<a name="l00373"></a>00373         <a class="code" href="classSetArgumentsVector.html" title="Class representing a vector of labelling assignment.">SetArgumentsVector</a> result=<a class="code" href="classSetArgumentsVector.html" title="Class representing a vector of labelling assignment.">SetArgumentsVector</a>(a);
<a name="l00374"></a>00374         <span class="keywordflow">for</span> (<span class="keyword">auto</span> it=b.<a class="code" href="classSetArgumentsVector.html#aa633ab749e1200f2321d80ce76a98505" title="return the first element of the list">begin</a>();it!=b.<a class="code" href="classSetArgumentsVector.html#a9a862e30af38a72e402e1ae4f7f5425b" title="return the last element of the list">end</a>();it++)
<a name="l00375"></a>00375                 result.<a class="code" href="classSetArgumentsVector.html#ae6509c9af6ffd7d9bbee2e0fbe3691ec" title="add a new SetArguments in this set">push_back</a>(*it);
<a name="l00376"></a>00376         <span class="keywordflow">return</span> result;
<a name="l00377"></a>00377 }
<a name="l00378"></a>00378 
<a name="l00384"></a><a class="code" href="classSetArgumentsVector.html#aa746bb341d961e7b5005b8687ae10d79">00384</a> <span class="keywordtype">void</span> <a class="code" href="classSetArgumentsVector.html#aa746bb341d961e7b5005b8687ae10d79" title="swap to different area of memory occupied by SetArgumentsVector">SetArgumentsVector::swap</a>(<a class="code" href="classSetArgumentsVector.html" title="Class representing a vector of labelling assignment.">SetArgumentsVector</a>&amp; first, <a class="code" href="classSetArgumentsVector.html" title="Class representing a vector of labelling assignment.">SetArgumentsVector</a>&amp; second){
<a name="l00385"></a>00385         <span class="keyword">using</span> <a class="code" href="classSetArgumentsVector.html#aa746bb341d961e7b5005b8687ae10d79" title="swap to different area of memory occupied by SetArgumentsVector">std::swap</a>;
<a name="l00386"></a>00386         <a class="code" href="classSetArgumentsVector.html#aa746bb341d961e7b5005b8687ae10d79" title="swap to different area of memory occupied by SetArgumentsVector">swap</a>(first.v,second.v);
<a name="l00387"></a>00387 }
<a name="l00388"></a>00388 
<a name="l00394"></a><a class="code" href="classSetArgumentsVector.html#ad7c955dec8507545c743d0bb637ea64e">00394</a> <a class="code" href="classSetArgumentsVector.html" title="Class representing a vector of labelling assignment.">SetArgumentsVector</a>&amp; <a class="code" href="classSetArgumentsVector.html#ad7c955dec8507545c743d0bb637ea64e" title="assign the same value of the rhs in the lhs">SetArgumentsVector::operator=</a>(<a class="code" href="classSetArgumentsVector.html" title="Class representing a vector of labelling assignment.">SetArgumentsVector</a> rhs){
<a name="l00395"></a>00395         <a class="code" href="classSetArgumentsVector.html#aa746bb341d961e7b5005b8687ae10d79" title="swap to different area of memory occupied by SetArgumentsVector">SetArgumentsVector::swap</a>(*<span class="keyword">this</span>,rhs);
<a name="l00396"></a>00396         <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00397"></a>00397 }
<a name="l00398"></a>00398 
<a name="l00399"></a>00399 
<a name="l00415"></a><a class="code" href="classSetArgumentsVector.html#a0a5149e33a856623c7430ac6053b6018">00415</a> <span class="keywordtype">bool</span> <a class="code" href="classSetArgumentsVector.html#a0a5149e33a856623c7430ac6053b6018" title="checks if the 2 SetArgumentsVector store the same SetArguments.">SetArgumentsVector::operator==</a>(<span class="keyword">const</span> <a class="code" href="classSetArgumentsVector.html" title="Class representing a vector of labelling assignment.">SetArgumentsVector</a> &amp;other)<span class="keyword"> const</span>{
<a name="l00416"></a>00416         <span class="keywordflow">if</span> (this-&gt;<a class="code" href="classSetArgumentsVector.html#acfa816d29faed3b3e19a48d0457c6f0a" title="the size of this set of SetArguments">size</a>()!=other.<a class="code" href="classSetArgumentsVector.html#acfa816d29faed3b3e19a48d0457c6f0a" title="the size of this set of SetArguments">size</a>())
<a name="l00417"></a>00417                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00418"></a>00418         <span class="keywordflow">for</span> (<span class="keyword">auto</span> it=this-&gt;<a class="code" href="classSetArgumentsVector.html#aa633ab749e1200f2321d80ce76a98505" title="return the first element of the list">begin</a>();it!=this-&gt;<a class="code" href="classSetArgumentsVector.html#a9a862e30af38a72e402e1ae4f7f5425b" title="return the last element of the list">end</a>();it++)
<a name="l00419"></a>00419                 <span class="keywordflow">if</span> (other.<a class="code" href="classSetArgumentsVector.html#a8cc07d968854d13c5dd4305bbcdaf96a" title="check wether or not a SetArguments exist in the caller SetArgumentsVector">exist</a>(*it)==<span class="keyword">false</span>)
<a name="l00420"></a>00420                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00421"></a>00421         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00422"></a>00422 }
<a name="l00423"></a>00423 
<a name="l00424"></a>00424 
<a name="l00440"></a><a class="code" href="classSetArgumentsVector.html#aaba29693afa29251637f31a8514ea527">00440</a> <span class="keywordtype">bool</span> <a class="code" href="classSetArgumentsVector.html#aaba29693afa29251637f31a8514ea527" title="checks if the 2 SetArgumentsVector differ from somthing.">SetArgumentsVector::operator!=</a>(<span class="keyword">const</span> <a class="code" href="classSetArgumentsVector.html" title="Class representing a vector of labelling assignment.">SetArgumentsVector</a> &amp;other)<span class="keyword"> const</span>{
<a name="l00441"></a>00441         <span class="keywordflow">return</span> !(*<span class="keyword">this</span>==other);
<a name="l00442"></a>00442 }
<a name="l00443"></a>00443 
<a name="l00444"></a>00444 
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="SetArgumentsVector_8cpp.html">SetArgumentsVector.cpp</a>      </li>

    <li class="footer">Generated on Fri Jan 17 2014 11:47:51 for SemOpt by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
